/*
Crazy Ball: Square Conflict
aka
Super Keith Sadeck World
Team Serious Bizne$$ Winter 2008

*/
#include <hge.h>
#include <hgesprite.h>
#include "ball.h"
#include "splash.h"
#include "play.h"

HGE *hge=0;

HTEXTURE bgtex;
hgeSprite *bgspr;


int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
	hge = hgeCreate(HGE_VERSION);

	hge->System_SetState(HGE_LOGFILE, "bizness.log");
	hge->System_SetState(HGE_FRAMEFUNC, Splash_Frame);
	hge->System_SetState(HGE_RENDERFUNC, Splash_Render);
	hge->System_SetState(HGE_TITLE, "Crazy Ball: Square Conflict");
	
	hge->System_SetState(HGE_FPS,80);
	hge->System_SetState(HGE_WINDOWED, true);
	hge->System_SetState(HGE_SCREENWIDTH, 800);
	hge->System_SetState(HGE_SCREENHEIGHT, 600);
	hge->System_SetState(HGE_SCREENBPP, 32);

	hge->System_SetState(HGE_SHOWSPLASH, false);

	if(hge->System_Initiate())
	{

		if(!Splash_Init()){ //this does not work, it just crashes if the image isn't there.
			//MessageBox(NULL, "Couldn't load serious.jpg", "Error", MB_OK | MB_ICONERROR | MB_APPLMODAL);
			hge->System_Shutdown();
			hge->Release();
			return 0;
		}
			
		hge->System_Start();

		//delete ball;
		//delete bgspr;
		//hge->Texture_Free(bgtex);
	}
	//else MessageBox(NULL, hge->System_GetErrorMessage(), "Error", MB_OK | MB_ICONERROR | MB_SYSTEMMODAL);

	hge->System_Shutdown();
	hge->Release();
	return 0;
}